package com.aimee.jobscheduler;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;

import androidx.annotation.Nullable;

public class PhoneService extends Service {

    private boolean isStop = true;

    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        isStop = true;
        new Thread(new Runnable() {
            @Override
            public void run() {
                while (isStop) {
                    Log.i(PhoneService.class.getName(), "手机种类有很多....");
                    try {
                        Thread.sleep(5 * 1000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
        }).start();
    }

    @Override
    public void onDestroy() {
        isStop = false;
        super.onDestroy();
    }
}
